package com.jml.mapreduce.WritableComparable;

import java.io.IOException;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Reducer;

public class CompareReducer extends Reducer<FlowBean, Text, Text, FlowBean>{

    @Override
    protected void reduce(FlowBean key, Iterable<Text> values, Context context)	throws IOException, InterruptedException {
        // 循环输出，避免总流量相同情况
        // 输出就反过来，决定了最后落到文本的key和value的前后顺序，电话号码在前面，就放在第一个参数
        for (Text text : values) {
            context.write(text, key);
        }
    }
}
